<template>
  <div id="app">
    <el-container>
      <el-aside width="250px">
        <div style="height: 60px;line-height: 60px;text-align: center">
          <p style="color:black;font-size: larger">餐具库存信息</p>
        </div>
        <div>
          <el-button class="back-button" type="text" @click="goBack">
            <i class="el-icon-arrow-left"></i> 返回
          </el-button>
        </div>
        <el-menu :default-openeds="['1', '3']">
          <el-submenu index="1">
            <template slot="title">容器</template>
            <el-menu-item-group>
              <template slot="title">碗</template>
              <el-menu-item index="1-1">镶金碗</el-menu-item>
              <el-menu-item index="1-2">瓷碗</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group title="杯">
              <el-menu-item index="1-3">塑料杯</el-menu-item>
              <el-menu-item index="1-4">高脚杯</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title">工具</template>
            <el-menu-item-group>
              <template slot="title">刀</template>
              <el-menu-item index="2-1">水果刀</el-menu-item>
              <el-menu-item index="2-2">镶金刀</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group title="叉">
              <el-menu-item index="2-3">铝叉</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group title="筷">
              <el-menu-item index="2-4">木筷</el-menu-item>
              <el-menu-item index="2-4">铝筷</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">其他</template>
            <el-menu-item-group>
              <template slot="title">餐巾纸</template>
              <el-menu-item index="3-1">大包</el-menu-item>
              <el-menu-item index="3-2">小包</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group title="手套">
              <el-menu-item index="3-3">一次性手套</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>

        <el-dialog title="库存信息" :visible.sync="dialogFormVisible">
          <el-form :model="form">
            <el-form-item label="餐具编号" :label-width="formLabelWidth">
              <el-input v-model="form.name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="餐具名称" :label-width="formLabelWidth">
              <el-input v-model="form.name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="数量" :label-width="formLabelWidth">
              <el-input v-model="form.name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="材质" :label-width="formLabelWidth">
              <el-input v-model="form.name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="所属航空公司" :label-width="formLabelWidth">
              <el-input v-model="form.name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="备注" :label-width="formLabelWidth">
              <el-input v-model="form.name" autocomplete="off"></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="dialogFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
          </div>
        </el-dialog>

      </el-aside>
      <el-main>
        <!-- 表格展示数据 -->
        <el-table :data="tableData" border stripe header-cell-class-name="headerBg">
          <el-table-column prop="AllocateID" label="餐具编号"width="120"></el-table-column>
          <el-table-column prop="TargetWH" label="餐具名称" width="140"></el-table-column>
          <el-table-column prop="OriWH" label="数量" width="120"></el-table-column>
          <el-table-column prop="TWid" label="材质"width="120"></el-table-column>
          <el-table-column prop="Num" label="所属航空公司"width="120"></el-table-column>
          <el-table-column prop="Date" label="备注"width="120"></el-table-column>
          <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button type="success">编辑<i class="el-icon-edit"></i></el-button>
              <el-button type="danger">删除<i class="el-icon-remove-outline"></i></el-button>
            </template>
          </el-table-column>
        </el-table>
        <div class="block">
    <span class="demonstration">直接前往</span>
    <el-pagination
      :page-size="100"
      layout="prev, pager, next, jumper"
      :total="1000">
    </el-pagination>
    </div>
        <div style=" padding: 10px 0;position:relative">
          <el-input style="width: 200px;margin-top:10px" placeholder="请输入调拨记录ID" suffix-icon="el-icon-search"></el-input>
          <el-input style="width: 200px;margin-top:10px" placeholder="请输入餐具编号" suffix-icon="el-icon-message" class="ml-5"></el-input>
          <el-button type="primary" style="margin-top: 10px">搜索</el-button>
          <el-button type="success" @click="dialogFormVisible = true">添加</el-button>
        </div>
      </el-main>
    </el-container>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        targetRepo: '',
        sourceRepo: '',
        utensilCode: '',
        transferDate: '',
        transferQuantity: '',
        allocationId: '',
        tableData: [
          { AllocateID: 59812, TargetWH: "Knife", OriWH: 5, TWid: "Stainless Steel", Num: "Air China", Date: "-" },
          { AllocateID: 82734, TargetWH: "Spoon", OriWH: 8, TWid: "Plastic", Num: "Delta Air Lines", Date: "-" },
          { AllocateID: 12345, TargetWH: "Napkin", OriWH: 12, TWid: "Paper", Num: "British Airways", Date: "-" },
          { AllocateID: 98765, TargetWH: "筷子", OriWH: 10, TWid: "竹子", Num: "中国国际航空公司", Date: "-" },
          { AllocateID: 65432, TargetWH: "勺子", OriWH: 6, TWid: "塑料", Num: "南方航空", Date: "-" },
          { AllocateID: 78901, TargetWH: "碗", OriWH: 4, TWid: "陶瓷", Num: "国航", Date: "-" },
          { AllocateID: 11223, TargetWH: "勺子", OriWH: 6, TWid: "塑料", Num: "南方航空", Date: "-" },
          { AllocateID: 33445, TargetWH: "碗", OriWH: 4, TWid: "陶瓷", Num: "国航", Date: "-" },
          { AllocateID: 55667, TargetWH: "茶杯", OriWH: 3, TWid: "玻璃", Num: "海南航空", Date: "-" },
          // ...
        ],
        form: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        },
        dialogFormVisible: false,
        formLabelWidth: '200px',
      };
    },
    methods: {
      goBack() {
        // 执行退出登录的逻辑
        // 返回登录页
        this.$router.push('/Index');
      },
    }
  }
</script>

<style>
  .el-container:nth-child(7) .el-aside {
    line-height: 440px;
  }
</style>
